/**
 * @author - lhn
 * @version - 1.0.0
 * @description - Promise 相关
 * @file - usePromise.ts
 * @datetime - 2025/2/28
 * @editor - lhn
 */


import IusePromise from './IUsePromise';

class UsePromise implements IusePromise {
  constructor() {
  }

  isPromiseLike(value: any) {
    return (
      value !== null &&
      (typeof value === 'object' || typeof value === 'function') &&
      (typeof value.then === 'function' || typeof value.catch === 'function')
    );
  }
}

const usePromise = new UsePromise();
export default usePromise;